package com.fansl.allround.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fansl
 * @Description: 邮件消息类型
 * @date 2019/10/10 12:45
 */
@Getter
@AllArgsConstructor
public enum EmailMessageTypeEnum {
    REGISTER(1,"注册");

    /**
     * 类型
     */
    private final int code;
    /**
     * 描述
     */
    private final String description;

    public static EmailMessageTypeEnum getByCode(int code){
        for (EmailMessageTypeEnum value:EmailMessageTypeEnum.values()){
            if(value.getCode()==code){
                return value;
            }
        }
        return REGISTER;
    }
}
